package com.briup.day18;

public class Test_Question {
    public static void main(String[] args) {
        int r = getNum(10, 0);
        System.out.println("r: " + r);
    }

    public static int getNum(int a, int b) {
        int n = 0;
        try {
            n = a / b;
        } catch (Exception e) {
            e.printStackTrace();
            n = 20;
//先建立返回通道，放入 n当前的值 20，在最终返回前，再去调用finally
            return n;
        } finally {
//System.out.println("in finally, n: " + n);
//20
            n = 30;
//System.out.println("in finally,最后 n: " + n);
//30
        }
        return n;
    }
}
